/*
    板子硬件情况定义，统一提供给APP或者其他驱动的名称
    GPIO的相关设置、模式切换建议定义在这里
*/
#ifndef _HARD_WIRED_H_
#define _HARD_WIRED_H_

#include "mcu\HC32\mcu.h"


// 所有GPIO的初始状态
#define GPIO_INIT       \
{\
	/* 开漏（输出）配置 1开启 默认关闭（推挽）*/\
	M0P_GPIO->P2OD = 0x00000008;			/* 0000 1000*/\
	/* 所有端口输出值 */\
    M0P_GPIO->P2OUT = 0XFFFFFFFF;           /* 1111 1111 */\
    /* 所有端口方向 1输入（默认）*/\
	/*M0P_GPIO->P0DIR = 0XFFFFFFFF;*/\
	/*M0P_GPIO->P1DIR = 0XFFFFFFFF;*/\
	M0P_GPIO->P2DIR = 0XFFFFFFF7;           /* 1111 0111 */\
	/*M0P_GPIO->P3DIR = 0XFFFFFFFF;*/\
	/* 所有端口模式 1模拟端口 0数字端口（默认）*/\
	/*M0P_GPIO->P0ADS = 0;*/\
	/*M0P_GPIO->P1ADS = 0;*/\
	/*M0P_GPIO->P2ADS = 0;*/\
	/*M0P_GPIO->P3ADS = 0;*/\
	/* 上拉配置 1开启 默认关闭*/\
	M0P_GPIO->P0PU = 0X0000FFF9;			/* 1111 1111 1111 1001*/\
	M0P_GPIO->P1PU = 0X0000FFFF;			/* 1111 1111 1111 1111*/\
	M0P_GPIO->P2PU = 0X0000FFF7;			/* 1111 1111 1111 0111*/\
	M0P_GPIO->P3PU = 0X0000FFFB;			/* 1111 1111 1111 1011*/\
	/* 下拉配置 1开启 默认关闭*/\
	/*M0P_GPIO->P0PD = 0X00000000;*/			/* 0000 0000 0000 0000*/\
	/*M0P_GPIO->P1PD = 0X00000000;*/			/* 0000 0000 0000 0000*/\
	/*M0P_GPIO->P2PD = 0X00000000;*/			/* 0000 0000 0000 0000*/\
	/*M0P_GPIO->P3PD = 0X00000000;*/			/* 0000 0000 0000 0000*/\
}

// 使能外部强下拉(导通发热丝)
#define ENABLE_OUT            M0P_GPIO->P2OUT = 0XFFFFFFF7
// 失能外部强下拉（断开发热丝）
#define DISABLE_OUT           M0P_GPIO->P2OUT = 0XFFFFFFFF


#define OVAL_PIN		M0P_GPIO->P3IN_f.P32
#define OVAL_PIN_INIT	{GPIO_RIE_ENABLE(3, 2); GPIO_FIE_ENABLE(3, 2); NVIC_EnableIRQ(PORT3_IRQn);}


#endif

